﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="EditTags.aspx.vb" Inherits="Assignment4.EditTags" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 87px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Edit Tags</h1>
    <asp:GridView ID="grvEditTags" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
        BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        DataKeyNames="TagId" DataSourceID="SqlDataSourceTags">
        <Columns>
            <asp:BoundField DataField="TagId" HeaderText="TagId" InsertVisible="False" 
                ReadOnly="True" SortExpression="TagId" Visible="False" />
            <asp:BoundField DataField="TagName" HeaderText="Content" 
                SortExpression="TagName" />
            <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" 
                Visible="False" />
            <asp:CheckBoxField DataField="Visible" HeaderText="Visible" ReadOnly="True" 
                SortExpression="Visible" />
            <asp:ButtonField CommandName="Select" Text="Select" />
        </Columns>
        <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
        <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
        <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
        <RowStyle BackColor="White" ForeColor="#003399" />
        <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
        <SortedAscendingCellStyle BackColor="#EDF6F6" />
        <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
        <SortedDescendingCellStyle BackColor="#D6DFDF" />
        <SortedDescendingHeaderStyle BackColor="#002876" />
    </asp:GridView>
    <br />
    <table class="style1">
        <tr>
            <td class="style2">
                Visible</td>
            <td>
                <asp:CheckBox ID="ChBVisible" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                Content</td>
            <td>
                <asp:TextBox ID="txtContent" runat="server"></asp:TextBox>
            &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="txtContent" CssClass="lblmessage" 
                    ErrorMessage="Enter Content" ValidationGroup="update"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:Button ID="btnUpdate" runat="server" Text="Update" 
                    ValidationGroup="update" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSourceTags" runat="server" 
        ConnectionString="<%$ ConnectionStrings:learningConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:learningConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [Tags]"></asp:SqlDataSource>
</asp:Content>
